module HomesHelper
  def link_to_enjoy_or_not(tool)
     if has_logined_by_user? 
       if tool.set_by_current_user? 
         link_to "正在享用", tool_url(:id => tool.id, :target => :enjoy), :target => :_blank , :class => :has_eated, :title => '您正在享用该吐司' 
       else 
         link_to "立即享用", tool_url(:id => tool.id, :target => :enjoy), :target => :_blank , :class => :eating, :title => '您还没尝过该吐司吧？赶紧！' 
       end 
     else 
       link_to "立即享用", tool_url(tool), :target => :_blank , :class => :eating, :title => '您还没尝过该吐司吧？赶紧！' 
     end 
  end
end
